﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    ViewData["Title"] = "Gantt Chart";
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewData["Title"]</title>
    <link rel="stylesheet" href="https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.css">
    @*   <script src="https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.js"></script> *@
    <script src="~/lib/1213/dhtmlxgantt.js"></script>
</head>
<body>
    <div id="gantt_here" style="width:100%; height:400px;"></div>

    <script>
    
        gantt.config.xml_date = "%Y-%m-%d %H:%i";
        gantt.init("gantt_here");

        // Example data
        var tasks = [
            { id: 1, text: "Project #1", start_date: "01-04-2023", duration: 18, progress: 0.4, link: "1231" },
            { id: 2, text: "Task #1", start_date: "02-04-2023", duration: 8, progress: 0.6, link: "1231" },
            { id: 3, text: "Task #2", start_date: "11-04-2023", duration: 8, progress: 0.6, link: "1231" }
        ];
        gantt.templates.task_text = function (start, end, task) {
            return task.text + " - " + (task.custom_name || "");
        };
        console.log(tasks, "11");
        gantt.init("gantt_here");
        gantt.parse({data:tasks});
    </script>
</body>
</html>